@@ -1,8 +1,11 @@ |
||
1 | 1 |
class @AgentShowPage |
2 | 2 |
constructor: -> |
3 |
- $('#target').click -> |
|
4 |
- $('#memorytoggle').toggleClass 'hidden' |
|
5 |
- return |
|
3 |
+ $('#toggle-memory').click -> |
|
4 |
+ if $('#memorypanel').hasClass('hidden') |
|
5 |
+ $('#memorypanel').removeClass 'hidden' |
|
6 |
+ else |
|
7 |
+ $('#memorypanel').addClass 'hidden' |
|
8 |
+ |
|
6 | 9 |
$(".agent-show #show-tabs a[href='#logs'], #logs .refresh").on "click", @fetchLogs |
7 | 10 |
$(".agent-show #logs .clear").on "click", @clearLogs |
8 | 11 |
$(".agent-show #memory .clear").on "click", @clearMemory |
@@ -57,5 +60,11 @@ class @AgentShowPage |
||
57 | 60 |
$("#memory .spinner").fadeOut -> |
58 | 61 |
$("#memory .clear").css(display: 'inline-block') |
59 | 62 |
|
63 |
+ $('#toggle-memory').click -> |
|
64 |
+ if $('#memorypanel').hasClass('hidden') |
|
65 |
+ $('#memorypanel').removeClass 'hidden' |
|
66 |
+ else |
|
67 |
+ $('#memorypanel').addClass 'hidden' |
|
68 |
+ |
|
60 | 69 |
$ -> |
61 | 70 |
Utils.registerPage(AgentShowPage, forPathsMatching: /^agents\/\d+/) |
@@ -161,16 +161,17 @@ |
||
161 | 161 |
<b>Options:</b> |
162 | 162 |
<pre><%= Utils.pretty_jsonify @agent.options || {} %></pre> |
163 | 163 |
</p> |
164 |
- <button type="submit" class="btn btn-default" id="target">Hide or Reveal Memory</button> |
|
165 |
- <div id="memorytoggle" class="hidden"> |
|
166 |
- <p id="memory" data-agent-id="<%= @agent.id %>"> |
|
167 |
- <b>Memory:</b> |
|
168 |
- <% if @agent.memory.present? %> |
|
169 |
- <i class="fa fa-spinner fa-pulse spinner"></i> |
|
170 |
- <i class="fa fa-trash action-icon clear"></i> |
|
171 |
- <% end %> |
|
172 |
- <pre class="memory"><%= Utils.pretty_jsonify @agent.memory || {} %></pre> |
|
173 |
- </p> |
|
164 |
+ <button type="submit" class="btn btn-default" id="toggle-memory">Show Memory</button> |
|
165 |
+ <div id="memorypanel" class="hidden"> |
|
166 |
+ <p id="memory" data-agent-id="<%= @agent.id %>"> |
|
167 |
+ <b>Memory:</b> |
|
168 |
+ <% if @agent.memory.present? %> |
|
169 |
+ <i class="fa fa-spinner fa-pulse spinner"></i> |
|
170 |
+ <i class="fa fa-trash action-icon clear"></i> |
|
171 |
+ <% end %> |
|
172 |
+ <pre class="memory"><%= Utils.pretty_jsonify @agent.memory || {} %></pre> |
|
173 |
+ </p> |
|
174 |
+ </div> |
|
174 | 175 |
</div> |
175 | 176 |
</div> |
176 | 177 |
</div> |